import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)
//cv以下代码解决路由地址重复的报错问题(一劳永逸)
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
   return originalPush.call(this, location).catch(err => err)
}
export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'homePage',
      component :() => import('../components/homePage')
    },
    {
      path: '/home',
      name: 'homePage',
      component :() => import('../components/homePage')
    },
    {
      path: '/rule',
      name: 'farmRulePage',
      component :() => import('../components/farmRulePage')
    },
    {
      path: '/qa',
      name: 'farmQaPage',
      component :() => import('../components/farmQaPage')
    },
    {
      path: '/mining',
      name: 'farmNBIPage',
      component :() => import('../components/farmNBIPage')
    },
  ]
})
